package at.guigu.config;

import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

// 配置静态资源的路径映射
public class SpringMvcSupport extends WebMvcConfigurationSupport {
    @Override
    protected void addResourceHandlers (ResourceHandlerRegistry registry) {
        // 当访问/pages/????时候，从/pages目录下查找内容
        // 配置静态资源的路径映射，开放某些资源的访问
        // 等同于<mvc:resources mapping="/xxx/**" location="/xx/"/>
        registry.addResourceHandler("/img/**").addResourceLocations("/img/");
    }
}